import greenfoot.*;  // (World, Actor, GreenfootImage, Greenfoot and MouseInfo)

/**
 * Write a description of class PonMagnetico here.
 * 
 * @author (Fco Fernando Gosch Acosta) 
 * @version (1.0)
 */
public class PonMagnetico extends Menu
{
    private static final int costo = 150;    
    
    /**
     * Act - do whatever the PonMagnetico wants to do. This method is called whenever
     * the 'Act' or 'Run' button gets pressed in the environment.
     */
    public void act() 
    {
        
        if(Greenfoot.mouseClicked(this) && ((Espacio) getWorld()).damePuntos() > costo )
        {
            int x = ((Espacio) getWorld()).dameXTierra();
            int y = ((Espacio) getWorld()).dameYTierra();
            getWorld().addObject(new Magnetica(0), x,y - 60);
            ((Espacio) getWorld()).bajaRecursos(costo);
        } 
    }    
}
